In video encoding/decoding an input video frame is encoded into an encoded video frame for storage or transmission, which encoded video frame is decoded in order to obtain a reconstruction of the original video signal. The encoding enables compression of the original video signal allowing that the compressed video signal can be stored on a storage medium requiring storage capacity which is only a small fraction of storage capacity that would be needed if the original video signal would be stored or transmission to another device requiring much less bandwidth, i.e. bits to be transmitted, compared to the bandwidth needed to transmit the original video signal.
In the art of video coding (H.264 [7] which is hereby incorporated by reference, H.263, MPEG2, MPEG4) the encoder performs all steps and makes all decisions necessary to compress the input video signal. All decisions taken by the encoder with respect to the encoding process are subsequently transmitted or stored for receipt or retrieval by the decoder and subsequently used in the decompression process. The decoder is passive in this respect and does not make any decisions on its own, operates dependently on the encoder. In recent contributions to Video Coding Expert Group (VCEG) of the International Telecommunication Union (ITU) adaptive filters have been proposed [1,2]. These filters are optimized on a frame by frame basis and coefficients are coded. They provide better coding efficiency than filters used in video compression standard H.264 for example.
Also there has been work on giving the decoder more freedom using template matching [3, 4, 5, 6], wherein the template refers to a region of previously decoded pixels adjacent to the block to be coded. All this has been attempted in an urge to further improve video encoding/decoding to achieve yet higher compression rates and/or improved perceived reconstructed image quality. In an attempt to further improve prediction, solutions have been investigated for adaptation of a prediction on a local basis.
Adaptation of a prediction on a local basis however costs many bits and can not be afforded for efficient video coding, where a more local adaptation potentially could reduce the prediction error. Local adaptive filters for inter-frame prediction could achieve this object, but are difficult to implement due the cost of coding filter coefficient and will cost many bits in storage or transmission.
Template matching is one way to achieve more local adaptation of a prediction without side information but in the matching search an area outside the predicted block is used. In other words the template matching search is based on reconstructed pixels other than the ones used for the actual prediction according to the best match. Errors in previously decoded regions due to communication channel errors or coding errors can propagate to the predicted block without any adjustments. It is therefore an object of the invention to enhance accuracy of predictions, i.e. predicted blocks, while preserving or limited increase of bandwidth, i.e. required bit capacity or bits to be encoded.